home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form Dial
- BorderStyle = 3 'Fixed Double
- Caption = "Phone Dialer"
- ClientHeight = 945
- ClientLeft = 2745
- ClientTop = 3210
- ClientWidth = 2805
- Height = 1350
- Left = 2685
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 945
- ScaleWidth = 2805
- Top = 2865
- Width = 2925
- Begin MSComm Comm1
- Interval = 1000
- Left = 120
- Top = 480
- End
- Begin CommandButton Command2
- Caption = "&Hang-Up"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Arial"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 375
- Left = 840
- TabIndex = 2
- Top = 480
- Visible = 0 'False
- Width = 1095
- End
- Begin CommandButton Command1
- Caption = "&Dial"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Arial"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 375
- Left = 840
- TabIndex = 1
- Top = 480
- Width = 1095
- End
- Begin TextBox Text1
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Courier"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 285
- Left = 120
- TabIndex = 0
- Top = 120
- Width = 2535
- End
- Sub Command1_Click ()
- 'dial the number mscomm makes it easy
- On Error Resume Next
- Comm1.CommPort = TheComm
- If Err Then
- Beep
- Msg$ = "Comm Port " & CStr(TheComm) & " Not Available."
- MsgBox Msg$, 16, ErrorMsg
- On Error GoTo 0
- Unload Dial
- End If
- Comm1.Settings = "300,N,8,1"
- Comm1.InputLen = 0
- Comm1.PortOpen = True
- Comm1.Output = "ATDT" & Trim$(Text1.Text) & ";" & Chr$(13)
- Command1.Visible = False
- Command2.Visible = True
- End Sub
- Sub Command2_Click ()
- 'hang up when user ready and unload
- Comm1.Output = "ATH" & Chr$(13)
- Unload Dial
- End Sub
- Sub Form_Load ()
- Dial.Top = Address.Top + (Address.Height - Dial.Height) \ 3
- Dial.Left = Address.Left + (Address.Width - Dial.Width) \ 2
- End Sub
- Sub Form_Unload (Cancel As Integer)
- 'need to make sure port is closed. error checking needed
- 'because we may have not opened the device before we unload
- On Error Resume Next
- Comm1.PortOpen = False
- On Error GoTo 0
- End Sub
-